package com.thrd.taiexhibition.model;

import com.alibaba.fastjson.JSON;
import com.thrd.basicframework.http.OkHttpUtils;
import com.thrd.basicframework.http.callback.ThrdCallBack;
import com.thrd.taiexhibition.bean.BeanThemeIndustry;
import com.thrd.taiexhibition.callback.MvpCallback;
import com.thrd.taiexhibition.utils.Constant;

/**
 * @author: ${唐杰}
 * @date: 2021/3/25
 */
public class ThemeIndustryHomeModel  {

    public static final String TAG="ThemeIndustryHomeModel";


    /**
     * 获取城市首页
     */
    public void getThemeIndustryHomeData(long id,final MvpCallback<BeanThemeIndustry> mvpCallback) {
        OkHttpUtils.post().url(Constant.HTTP_THEME_INDUSTRY_HOME)
                .tag(TAG)
                .addParams("Eid", String.valueOf(id))
                .build().execute(new ThrdCallBack<BeanThemeIndustry>() {
            @Override
            public void onFailed(String e, int code) {
                mvpCallback.onFailed(e, code);
            }
            @Override
            public void onResponse(BeanThemeIndustry response, int id) {
                mvpCallback.onSuccess(response);
            }
            @Override
            public BeanThemeIndustry onJson(String s) {
                return JSON.parseObject(s, BeanThemeIndustry.class);
            }


        });
    }
}
